home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 26 / AACD 26.iso / AACD / Online / PHP / include / php / ext / standard / php_output.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-06  |  3.6 KB  |  97 lines

  1. /*
  2.    +----------------------------------------------------------------------+
  3.    | PHP version 4.0                                                      |
  4.    +----------------------------------------------------------------------+
  5.    | Copyright (c) 1997-2001 The PHP Group                                |
  6.    +----------------------------------------------------------------------+
  7.    | This source file is subject to version 2.02 of the PHP license,      |
  8.    | that is bundled with this package in the file LICENSE, and is        |
  9.    | available at through the world-wide-web at                           |
  10.    | http://www.php.net/license/2_02.txt.                                 |
  11.    | If you did not receive a copy of the PHP license and are unable to   |
  12.    | obtain it through the world-wide-web, please send a note to          |
  13.    | license@php.net so we can mail you a copy immediately.               |
  14.    +----------------------------------------------------------------------+
  15.    | Authors: Zeev Suraski <zeev@zend.com>                                |
  16.    +----------------------------------------------------------------------+
  17. */
  18.  
  19. /* $Id: php_output.h,v 1.23 2001/03/06 16:28:51 zeev Exp $ */
  20.  
  21. #ifndef PHP_OUTPUT_H
  22. #define PHP_OUTPUT_H
  23.  
  24. #include "php.h"
  25.  
  26. typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode);
  27.  
  28. PHPAPI void php_output_startup(void);
  29. void php_output_register_constants(void);
  30. PHPAPI int  php_body_write(const char *str, uint str_length);
  31. PHPAPI int  php_header_write(const char *str, uint str_length);
  32. PHPAPI int php_start_ob_buffer(zval *output_handler, uint chunk_size);
  33. PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush);
  34. PHPAPI void php_end_ob_buffers(zend_bool send_buffer);
  35. PHPAPI int php_ob_get_buffer(pval *p);
  36. PHPAPI int php_ob_get_length(pval *p);
  37. PHPAPI void php_start_implicit_flush(void);
  38. PHPAPI void php_end_implicit_flush(void);
  39. PHPAPI char *php_get_output_start_filename(void);
  40. PHPAPI int php_get_output_start_lineno(void);
  41. PHPAPI void php_ob_set_internal_handler(php_output_handler_func_t internal_output_handler, uint buffer_size);
  42.  
  43. PHP_FUNCTION(ob_start);
  44. PHP_FUNCTION(ob_end_flush);
  45. PHP_FUNCTION(ob_end_clean);
  46. PHP_FUNCTION(ob_get_contents);
  47. PHP_FUNCTION(ob_get_length);
  48. PHP_FUNCTION(ob_implicit_flush);
  49.  
  50. PHP_GINIT_FUNCTION(output);
  51.  
  52. typedef struct _php_ob_buffer {
  53.     char *buffer;
  54.     uint size;
  55.     uint text_length;
  56.     int block_size;
  57.     uint chunk_size;
  58.     int status;
  59.     zval *output_handler;
  60.     php_output_handler_func_t internal_output_handler;
  61.     char *internal_output_handler_buffer;
  62.     uint internal_output_handler_buffer_size;
  63. } php_ob_buffer;
  64.  
  65. typedef struct _php_output_globals {
  66.     int (*php_body_write)(const char *str, uint str_length);        /* string output */
  67.     int (*php_header_write)(const char *str, uint str_length);    /* unbuffer string output */
  68.     php_ob_buffer active_ob_buffer;
  69.     unsigned char implicit_flush;
  70.     char *output_start_filename;
  71.     int output_start_lineno;
  72.     zend_stack ob_buffers;
  73.     int nesting_level;
  74.     zend_bool lock;
  75. } php_output_globals;
  76.  
  77.  
  78. #ifdef ZTS
  79. #define OLS_D php_output_globals *output_globals
  80. #define OLS_C output_globals
  81. #define OG(v) (output_globals->v)
  82. #define OLS_FETCH() php_output_globals *output_globals = ts_resource(output_globals_id)
  83. ZEND_API extern int output_globals_id;
  84. #else
  85. #define OLS_D void
  86. #define OLS_C
  87. #define OG(v) (output_globals.v)
  88. #define OLS_FETCH()
  89. ZEND_API extern php_output_globals output_globals;
  90. #endif
  91.  
  92. #define PHP_OUTPUT_HANDLER_START        (1<<0)
  93. #define PHP_OUTPUT_HANDLER_CONT            (1<<1)
  94. #define PHP_OUTPUT_HANDLER_END            (1<<2)
  95.  
  96. #endif /* PHP_OUTPUT_H */
  97.